package config

import (
	_ "embed"

	"github.com/pelletier/go-toml/v2"
)

func InitConfig() PayCert {
	var c PayCert
	err := toml.Unmarshal(config, &c)
	if err != nil {
		panic(err)
	}
	return c
}

//go:embed config.toml
var config []byte

type PayCert struct {
	MchID                      string `json:"mch_id" toml:"mch_id"`
	MchCertificateSerialNumber string `json:"mch_certificate_serial_number" toml:"mch_certificate_serial_number"`
	MchAPIv3Key                string `json:"mch_apiv3_key" toml:"mch_apiv3_key"`
}
